// numeric_limits example
#include <iostream> // std::cout
#include <limits>   // std::numeric_limits

int main() {
  std::cout << std::boolalpha;
  std::cout << "整型最小值 " << std::numeric_limits<int>::min() << " 最大值："
            << std::numeric_limits<int>::max() << " 是否有符号"
            << std::numeric_limits<int>::is_signed << " "
            << " 是否无穷：" << std::numeric_limits<int>::has_infinity
            << " lowerest值：" << std::numeric_limits<int>::lowest() << "\n";
  std::cout << "浮点数最小值 " << std::numeric_limits<float>::min()
            << " 最大值：" << std::numeric_limits<float>::max() << " 是否有符号"
            << std::numeric_limits<float>::is_signed << " "
            << " 是否无穷：" << std::numeric_limits<float>::has_infinity
            << " lowest 值：" << std::numeric_limits<float>::lowest() << "\n";
  std::cout << "双精度浮点数最小值 " << std::numeric_limits<float>::min()
            << " 最大值：" << std::numeric_limits<double>::max()
            << " 是否有符号" << std::numeric_limits<double>::is_signed << " "
            << " 是否无穷：" << std::numeric_limits<double>::has_infinity
            << " lowest值:" << std::numeric_limits<double>::lowest() << "\n";
  std::cout << "无符号8位整型最小值 "
            << -std::numeric_limits<unsigned char>::min() << " 最大值 "
            << +std::numeric_limits<unsigned char>::max() << " 是否有符号"
            << std::numeric_limits<unsigned char>::is_signed << " "
            << " 是否无穷：" << std::numeric_limits<unsigned char>::has_infinity
            << " lowest值：" << +std::numeric_limits<unsigned char>::lowest()
            << '\n';
  std::cout << "有符号8位整型最小值 "
            << -std::numeric_limits<signed char>::min() << " 最大值 "
            << +std::numeric_limits<signed char>::max() << " 是否有符号"
            << std::numeric_limits<signed char>::is_signed << " "
            << " 是否无穷：" << std::numeric_limits<signed char>::has_infinity
            << " lowest值：" << +std::numeric_limits<signed char>::lowest()
            << '\n';
  std::cout << "宽wchar最小值 " << -std::numeric_limits<wchar_t>::min()
            << " 最大值 " << +std::numeric_limits<wchar_t>::max()
            << " 是否有符号" << std::numeric_limits<wchar_t>::is_signed << " "
            << " 是否无穷：" << std::numeric_limits<wchar_t>::has_infinity
            << " lowest值：" << +std::numeric_limits<wchar_t>::lowest() << '\n';
  std::cout << "bool最小值 " << -std::numeric_limits<bool>::min() << " 最大值 "
            << +std::numeric_limits<bool>::max() << " 是否有符号"
            << std::numeric_limits<bool>::is_signed << " "
            << " 是否无穷：" << std::numeric_limits<bool>::has_infinity
            << " lowest值：" << +std::numeric_limits<bool>::lowest() << '\n';

  std::cout << "char最小值 " << -std::numeric_limits<char>::min() << " 最大值 "
            << +std::numeric_limits<char>::max() << " 是否有符号"
            << std::numeric_limits<char>::is_signed << " "
            << " 是否无穷：" << std::numeric_limits<char>::has_infinity
            << " lowest值：" << +std::numeric_limits<char>::lowest() << '\n';

  std::cout << "char16_t最小值 " << -std::numeric_limits<char16_t>::min()
            << " 最大值 " << +std::numeric_limits<char16_t>::max() << '\t'
            << " 是否有符号" << std::numeric_limits<char16_t>::is_signed << " "
            << " 是否无穷：" << std::numeric_limits<char16_t>::has_infinity
            << " lowest值：" << +std::numeric_limits<char16_t>::lowest()
            << '\n';

  std::cout << "宽char32_t最小值 " << -std::numeric_limits<char32_t>::min()
            << " 最大值 " << +std::numeric_limits<char32_t>::max() << '\t'
            << " 是否有符号" << std::numeric_limits<char32_t>::is_signed << " "
            << " 是否无穷：" << std::numeric_limits<char32_t>::has_infinity
            << " lowest值：" << +std::numeric_limits<char32_t>::lowest()
            << '\n';

  std::cout << "short最小值 " << -std::numeric_limits<short>::min()
            << " 最大值 " << +std::numeric_limits<short>::max() << '\t'
            << " 是否有符号" << std::numeric_limits<short>::is_signed << " "
            << " 是否无穷：" << std::numeric_limits<short>::has_infinity
            << " lowest值：" << +std::numeric_limits<short>::lowest() << '\n';

  std::cout << "无符号short最小值 "
            << -std::numeric_limits<unsigned short>::min() << " 最大值 "
            << +std::numeric_limits<unsigned short>::max() << '\t'
            << " 是否有符号" << std::numeric_limits<unsigned short>::is_signed
            << " "
            << " 是否无穷："
            << std::numeric_limits<unsigned short>::has_infinity
            << " lowest值：" << +std::numeric_limits<unsigned short>::lowest()
            << '\n';

  std::cout << "无符号整型最小值 " << -std::numeric_limits<unsigned int>::min()
            << " 最大值 " << +std::numeric_limits<unsigned int>::max() << '\t'
            << " 是否有符号" << std::numeric_limits<unsigned int>::is_signed
            << " "
            << " 是否无穷：" << std::numeric_limits<unsigned int>::has_infinity
            << " lowest值：" << +std::numeric_limits<unsigned int>::lowest()
            << '\n';

  std::cout << "long最小值 " << -std::numeric_limits<long>::min() << " 最大值 "
            << +std::numeric_limits<long>::max() << '\t' << " 是否有符号"
            << std::numeric_limits<long>::is_signed << " "
            << " 是否无穷：" << std::numeric_limits<long>::has_infinity
            << " lowest值：" << +std::numeric_limits<long>::lowest() << '\n';

  std::cout << "无符号的long最小值 "
            << -std::numeric_limits<unsigned long>::min() << " 最大值 "
            << +std::numeric_limits<unsigned long>::max() << '\t'
            << " 是否有符号" << std::numeric_limits<unsigned long>::is_signed
            << " "
            << " 是否无穷：" << std::numeric_limits<unsigned long>::has_infinity
            << " lowest值：" << +std::numeric_limits<unsigned long>::lowest()
            << '\n';

  std::cout << "long long最小值 " << -std::numeric_limits<long long>::min()
            << " 最大值 " << +std::numeric_limits<long long>::max() << '\t'
            << " 是否有符号" << std::numeric_limits<long long>::is_signed << " "
            << " 是否无穷：" << std::numeric_limits<long long>::has_infinity
            << " lowest值：" << +std::numeric_limits<long long>::lowest()
            << '\n';

  std::cout << "无符号的long long最小值 "
            << -std::numeric_limits<unsigned long long>::min() << " 最大值 "
            << +std::numeric_limits<unsigned long long>::max() << '\t'
            << " 是否有符号"
            << std::numeric_limits<unsigned long long>::is_signed << " "
            << " 是否无穷："
            << std::numeric_limits<unsigned long long>::has_infinity
            << " lowest值："
            << +std::numeric_limits<unsigned long long>::lowest() << '\n';

  std::cout << "long double最小值 " << -std::numeric_limits<long double>::min()
            << " 最大值 " << +std::numeric_limits<long double>::max() << '\t'
            << " 是否有符号" << std::numeric_limits<long double>::is_signed
            << " "
            << " 是否无穷：" << std::numeric_limits<long double>::has_infinity
            << " lowest值：" << +std::numeric_limits<long double>::lowest()
            << '\n';

  return 0;
}
